<?php
/**
* @author: Pham Van Diep
* @date:   18/2/2014
*/

/**
* Not login
* Not permission
*
* Note: only root, administrator, leader with permission admin module
*/
if( !isset($AppUI) || 	
    !isset($_SESSION['club_img']) ||
    ($_SESSION['club_img']&1<<0) == 0 
) {
	redirect(HOST_BACKEND);
}

$intPage    = $this->input->get('page', 1);
$strStart   = $this->input->get('startdate', null);
$strEnd     = $this->input->get('enddate', null);
$strStatus  = $this->input->get('status',1);
$intSrcId   = $this->input->get('src',0);
$intClubId  = $this->input->get('id',0);
$intLimit   = PAGING_NUMBER;
$intOffset  = ($intPage-1)*$intLimit;

$arrResult	= $this->image->getAll($AppUI->id, $strStatus, $intClubId, CI_Function::convertStrToDate($strStart),CI_Function::convertStrToDate($strEnd),$intOffset, $intLimit, $intTotal);
$this->smarty->assign('arrResult',  $arrResult);
$this->smarty->assign('intTotal',   $intTotal);
$this->smarty->assign('intOffset',  $intOffset);
$this->smarty->assign('intLimit',   $intLimit);
$this->smarty->assign('intSrcId',   $intSrcId);
$this->smarty->assign('intClubId',  $intClubId);
$this->smarty->display('image/index.tpl');